package im.starchat.chat.rest.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;

/**
 * Created by liuchao on 3/11/16.
 */
public class CommentBean implements Parcelable{

    private int id;// 用户 id
    private int room_id;
    private String message;
    private String created_at;
    private int seconds_from_start_at;

    private UserBean user;


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getRoom_id() {
        return room_id;
    }

    public void setRoom_id(int room_id) {
        this.room_id = room_id;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getCreated_at() {
        return created_at;
    }

    public void setCreated_at(String created_at) {
        this.created_at = created_at;
    }

    public int getSeconds_from_start_at() {
        return seconds_from_start_at;
    }

    public void setSeconds_from_start_at(int seconds_from_start_at) {
        this.seconds_from_start_at = seconds_from_start_at;
    }

    public UserBean getUser() {
        return user;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public CommentBean(Parcel parcel){
        this.id=parcel.readInt();
        this.room_id=parcel.readInt();
        this.created_at=parcel.readString();
        this.message=parcel.readString();
        this.user=parcel.readParcelable(CommentBean.class.getClassLoader());
    }
    @Override
    public void writeToParcel(Parcel parcel, int i) {
         parcel.writeInt(this.id);
         parcel.writeInt(this.getRoom_id());
         parcel.writeString(this.message);
         parcel.writeString(this.created_at);
         parcel.writeParcelable(this.user,0);
    }

    public static final Parcelable.Creator<CommentBean> CREATOR = new Creator<CommentBean>(){
        @Override
        public CommentBean createFromParcel(Parcel parcel) {
            return new CommentBean(parcel);
        }

        @Override
        public CommentBean[] newArray(int i) {
            return new CommentBean[0];
        }
    };
}
